###

events: ['added', 'removed'],

###
class tree.ui.Rect extends tree.BaseObject
	constructor: (x, y, width, height) ->
	    super
	    BORDER = 0
	    @x = parseInt x
	    @y = parseInt y
	    @width = parseInt(width) + BORDER
	    @height = parseInt(height) + BORDER
		
	top: () ->
	    return @y
	
	bottom: () ->
	    return @y + @height
	
	left: () ->
	    return @x
	
	right: () ->
	    return @x + @width
	    
	collides: (x, y) ->
	    if @left() < x < @right() and @top() < y < @bottom()
	        return true
	    return false
